<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>
			Ticket To Ride - <ui:insert name="title">Index</ui:insert>
		</title>
		<h:outputStylesheet name="default.css" library="css" />
		<h:outputStylesheet name="richfaces.css" library="css" />
	</h:head>
	<h:body>
		<header>
			<ui:insert name="header">
				<h:form id="_formHeader">
				<rich:toolbar rendered="#{sessionBean.loggedIn}">
					<rich:toolbarGroup>
						<rich:dropDownMenu disabled="#{not menuBean.enabled}">
							<f:facet name="label">
								<h:graphicImage name="gnome-fs-home.png" library="images/nouveGnome/16x16/filesystems" />
								<h:outputText value="#{messages['label.mainMenu']}"/>
							</f:facet>
							<rich:menuGroup label="#{messages['label.managment']}" icon="/resources/images/nouveGnome/16x16/emblems/emblem-bin.png">
								<rich:menuItem label="#{messages['label.application']}" action="#{applicationBean.start}" rendered="#{sessionBean.inRoleAdministrator or sessionBean.inRoleManager}">
									<f:facet name="icon">
										<h:graphicImage name="applications-other.png" library="images/nouveGnome/16x16/categories" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem label="#{messages['label.certificate']}" action="#{certificateBean.start}" rendered="#{sessionBean.inRoleAdministrator or sessionBean.inRoleManager}">
									<f:facet name="icon">
										<h:graphicImage name="emblem-desktop.png" library="images/nouveGnome/16x16/emblems" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem label="#{messages['label.ticket']}" action="#{ticketBean.start}">
									<f:facet name="icon">
										<h:graphicImage name="emblem-mail.png" library="images/nouveGnome/16x16/emblems" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem label="#{messages['label.user']}" action="#{userBean.start}" rendered="#{sessionBean.inRoleAdministrator}">
									<f:facet name="icon">
										<h:graphicImage name="emblem-people.png" library="images/nouveGnome/16x16/emblems" />
									</f:facet>
								</rich:menuItem>
							</rich:menuGroup>
							<rich:menuItem label="#{messages['label.logout']}" action="#{loginBean.logout}">
								<f:facet name="icon">
									<h:graphicImage name="exit.png" library="images/nouveGnome/16x16/actions" />
								</f:facet>
							</rich:menuItem>
						</rich:dropDownMenu>
					</rich:toolbarGroup>
					<rich:toolbarGroup location="right">
						<h:graphicImage name="user-info.png" library="images/nouveGnome/16x16/apps" />
						<h:outputText value="#{sessionBean.user.name}" />
					</rich:toolbarGroup>
				</rich:toolbar>
			</h:form>
			</ui:insert>
		</header>
		
		<aside>
			<br />
			<rich:popupPanel id="globalMessagesPopup" header="#{messages['label.message']}" width="300" height="200" modal="true" resizeable="false" moveable="false" show="true" rendered="#{not empty facesContext.messageList}">
				<f:facet name="controls">
					<h:outputLink value="#" onclick="#{rich:component('globalMessagesPopup')}.hide(); return false;">
						<h:graphicImage name="exit.png" library="images/nouveGnome/16x16/actions" />
					</h:outputLink>	
				</f:facet>
				<rich:messages />
			</rich:popupPanel>
			<ui:insert name="content"></ui:insert>
		</aside>
	
		<footer>
			<ui:insert name="footer">
				<h:form id="formFooter">
					Woodstock Tecnologia
				</h:form>
			</ui:insert>
		</footer>
	</h:body>
</html>